#插入排序是将元素插入到一个有序序列中
def insertSort(list):
    if len(list)<=1:
        return list
    tem = 0
    for i in range(len(list)):
        j=i-1
        tem = list[i]
        while j>=0 and tem < list[j]:
            list[j+1] = list[j]
            j-=1
        list[j+1]=tem
    return list
list = insertSort([1,4,2,8,0,5,1,6])
print(list)
